package com.musemun.pojo;

import com.google.zxing.WriterException;
import com.musemun.contants.StaticVariable;
import com.musemun.util.TwoCodeUtil;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.IOException;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Api("拍照入数据库返回id,图片链接,base64二维码图片")
public class ResultPhoto {

    long crNo;
    String image;
    String TwoCodeImage;

    public ResultPhoto(Crifo crifo) throws IOException, WriterException {
        String TwoCodeImage=TwoCodeUtil.generateCodeBufferImage(StaticVariable.URL+"/two_dimensional_code/by_image/"+crifo.getCrNo());
        this.crNo=crifo.getCrNo();
        this.image=crifo.getCrPic();
        this.TwoCodeImage=TwoCodeImage;
    }
}
